home *** CD-ROM | disk | FTP | other *** search
- Path: newshost.lanl.gov!tanmoy
- From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
- Newsgroups: comp.lang.c
- Subject: Re: Locaton of an array?
- Date: 12 Jan 1996 06:06:27 GMT
- Organization: Los Alamos National Laboratory
- Message-ID: <TANMOY.96Jan11230627@qcd.lanl.gov>
- References: <4d4iqk$hs3@overload.lbl.gov> <maverickDL1u3x.45I@netcom.com>
- NNTP-Posting-Host: qcd.lanl.gov
- Mime-Version: 1.0
- Content-Type: text
- In-reply-to: maverick@netcom.com's message of Fri, 12 Jan 1996 03:39:47 GMT
-
- --text follows this line--
- In article <maverickDL1u3x.45I@netcom.com> maverick@netcom.com (Chris
- Shepard) writes:
- <snip>
- #include <the usual stuff>
- undefined behavious :-)
-
- int main(void)
- {
- char arr[10],
- *p;
-
- p=arr;
- printf("addr of arr = %p\n",p);
-
- undefined behaviour! make that
- printf("addr of arr = %p\n",(void*)p);
-
- (Actually with p a char*, it is a technicality: but why not write
- technically correct code? :-)
-
- return(EXIT_SUCCESS);
- }
-
- Btw, just out of curiosity, why do you care where it lives in
- absolute RAM?
-
- By the way, the output of %p (as also the result of the (int) cast on
- a pointer) is upto the implementation. C can be implemented on machines
- which have no natural mapping onto a flat address space, so the
- original question may not have a definite meaning. An answer to the
- `why' that you ask is definitely required before more help can be
- provided.
-
- Cheers
- Tanmoy
- --
- tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
- Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
- Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
- <http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
- internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
- fax: 1 (505) 665 3003 voice: 1 (505) 665 4733 [ Home: 1 (505) 662 5596 ]
-